<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="./js/vue.min.js"></script>
    <!--<script type="text/javascript" src="./js/axios.min.js"></script>-->
    <script type="text/javascript" src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>

<div id="application">
    <input type="button" value="点击或取随机笑话" @click="getJoke">
    <p v-text="joke"></p>
</div>

<script type="text/javascript">
    let vueModel = new Vue({
        el : "#application",
        data : {
            joke : "笑话案例"
        },
        methods : {
            getJoke : function () {
                let that = this; // 注意要在这里声明变量接受
                axios.get("https://autumnfish.cn/api/joke").then(
                  function (response) {
                    console.log(response);
                    that.joke = response.data;
                  },
                  function (err) {
                    alert(err);
                  }
                );
            }
        }
    });
</script>

</body>
</html>